package com.example.publice.fileUpload.controller;


import com.example.publice.config.ExampleConfigValue;
import com.example.publice.fileUpload.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/sys/file")
public class FileController {


    @Autowired
    private ExampleConfigValue configValue;

    @GetMapping
    public void upload(HttpServletResponse response) throws Exception {
        FileUtil.downloadFile(configValue.getTemporaryPath() + "/gen.zip", "gen.zip", true, response);
    }


}
